<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
</head>
<body>
<div id="app">
  <input v-model="username " placeholder="请输入账号">
  <br>
  <input v-model="password" placeholder="请输入密码">
  <br>
  <button v-on:click="submit">登陆</button>
  <button v-on:click="logout">登出</button>
</div>
</body>

<script>
  var app = new Vue({
    el: '#app',
    data: {
      username:"",
      password: "",
    },
    methods: {
    submit:function(){
      axios({
        method:'post',
        url:'http://localhost:18080/login?username='+this.username+"&password="+this.password,
        
        data:{
          // username:this.username,
          // password:this.psw
        },
      }).then(function (response) {
         console.log(response.data)
        } )
    },
    logout:function(){
      axios({
        method:'get',
        url:'http://localhost:18080/logout',
        
        data:{
          // username:this.username,
          // password:this.password
        },
      }).then(function (response) {
         console.log(response)
        } )
    }
  }
  })
</script>
</html>